#include <iostream>
#include <cstdio>

using namespace std;

int n,m,a,b,t;
char s[100005];

int main(){
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    srand(time(0));
    cin>>n>>m;
    for(int i=1;i<=n;i++)scanf("%d",&a);
    for(int i=1;i<=m;i++)scanf("%d",&a);
    a=1;
    while(a<n)a*=2,b++;
    for(int i=1;i<=b;i++)scanf("%s",&s);
    cin>>t;
    for(int i=1;i<=t;i++){
        cout<<rand()%1024<<' ';
    }
    return 0;
}
